<?php

namespace app\common\server;

use \think\facade\Db;

use extend\oss\autoload;

require_once '../extend/oss/autoload.php';

use \OSS\Core\OssException;
use \OSS\OssClient;

class Upload
{
    private $accessKeyId = '';
    private $accessKeySecret = '';
    private $endpoint = '';
    private $bucket = '';

    //上传文件
    public function uploadFile($oss_path, $file_path)
    {
        $ossClient = new OssClient($this->accessKeyId, $this->accessKeySecret, $this->endpoint);
        $data = $ossClient->uploadFile($this->bucket, $oss_path, $file_path);
        return $oss_path;
    }


}